var app = new Vue({
    el: "#app",
    data: {
        city: '',
        forecast: []
    },
    methods: {
        search: function() {
            var that = this;
            axios.get(`http://wthrcdn.etouch.cn/weather_mini?city=${this.city}`).then(
                (res) => {
                    that.forecast = res.data.data.forecast;
                }).catch(
                (err) => {
                    console.log(err);
                }
            )
        },
        changeCity: function(city) {
            this.city = city;
            this.search();
        }
    }
})